home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 27.zip / BS1 part 27 / Superbase4_d1.adf / InstallSB < prev    next >
Text File  |  1993-06-25  |  13KB  |  382 lines

  1. ; this is an install script for SBase4 Professional
  2. ; the following two tooltypes should be on the invokation project icon:
  3. ;         MINUSER=AVERAGE
  4. ;         APPNAME=SBase4pro
  5. ;
  6.  
  7.  
  8. (copyfiles
  9.    (source "Install_SBase4pro:lharc")
  10.    (dest "ram:")
  11.    (infos)
  12. )
  13. (copyfiles
  14.    (source "Install_SBase4pro:Disk.info")
  15.    (dest "ram:")
  16.    (infos)
  17. )
  18.  
  19. (onerror
  20.    (delete "ram:lharc" (safe))
  21.    (delete "ram:Disk.info" (safe))
  22. )
  23.  
  24. (set installlevel 3)
  25.  
  26. (if (IN installlevel 0)
  27.    (
  28.       (set length_ok 1)
  29.  
  30.       (set serialno "")
  31.  
  32.       (while length_ok
  33.          (set serialno
  34.             (askstring
  35.                (prompt "Please enter your serial no. which is printed on"
  36.                        " your installation disk.")
  37.                (help @askstring-help)
  38.                (default serialno)
  39.             )
  40.          )
  41.          (if (= (strlen serialno) 8)
  42.             (set length_ok 0)
  43.             (message "Improper serial no.")
  44.          )
  45.       )
  46.  
  47.       (set length_ok 1)
  48.  
  49.       (set name "")
  50.  
  51.       (while length_ok
  52.          (set name
  53.             (askstring
  54.                (prompt "Please enter your name.  This must be at least 6"
  55.                        " characters long, and less than 40 characters long.")
  56.                (help @askstring-help)
  57.                (default name)
  58.             )
  59.          )
  60.          (if (< (strlen name) 6)
  61.             (message "name must be at least 6 characters long")
  62.             (if (> (strlen name) 39)
  63.                (message "name must be less than 40 characters long")
  64.                (set length_ok 0)
  65.             )
  66.          )
  67.       )
  68.  
  69.       (set length_ok 1)
  70.  
  71.       (set org "")
  72.  
  73.       (while length_ok
  74.          (set org
  75.             (askstring
  76.                (prompt "Please enter your organization.  This must be at least 6"
  77.                        " characters long, and less than 40 characters long.")
  78.                (help @askstring-help)
  79.                (default org)
  80.             )
  81.          )
  82.          (if (< (strlen org) 6)
  83.             (message "organization must be at least 6 characters long")
  84.             (if (> (strlen org) 39)
  85.                (message "organization must be less than 40 characters long")
  86.                (set length_ok 0)
  87.             )
  88.          )
  89.       )
  90.    )
  91. )
  92.  
  93. (set sb_install
  94.    (askbool
  95.       (prompt "Do you wish to install to Floppy or Hard Disk?")
  96.       (help "If you install to Floppy, it will generate two"
  97.             " floppys.  If you install to Hard Disk, then all files"
  98.             " will be placed in"
  99.             " one directory on your hard drive.")
  100.       (choices "Floppy" "Hard Disk")
  101.       (default 1)
  102.    )
  103. )
  104.  
  105. (if sb_install
  106.    (  ; --- floppy install **************************************
  107.       (set disk_ready 0)
  108.       (if (= installlevel 3)
  109.          (set disk_ready
  110.             (askbool
  111.                (prompt "To install to floppy disks requires two formatted"
  112.                        " floppys labeled \"SBase4pro:\", and \"SBase4:\"."
  113.                        "  If you do not have these ready"
  114.                        " then please exit this installation procedure, prepare"
  115.                        " them, and re-start the installation.")
  116.                (help "SBase4pro: will hold all program files except for"
  117.                      " the form designer.  SBase4: will be used for the"
  118.                      " form designer program and some extra examples.")
  119.                (choices "Continue" "Exit")
  120.                (default 1)
  121.             )
  122.          )
  123.       )
  124.       (if disk_ready
  125.          (
  126.             (if (IN installlevel 0)
  127.                (
  128.                   (set @default-dest "SBase4")
  129.                   (copyfiles
  130.                      (source "Install_SBase4pro:prog.lzh")
  131.                      (dest "ram:")
  132.                   )
  133.                   (copyfiles
  134.                      (source "Install_SBase4pro:printers.lzh")
  135.                      (dest "ram:")
  136.                   )
  137.                   (copyfiles
  138.                      (source "Install_SBase4pro:registersb")
  139.                      (dest "ram:")
  140.                   )
  141.                   (askdisk
  142.                      (prompt "Please insert the diskette labeled \"SBase4pro\""
  143.                              " in any drive.")
  144.                      (help @askdisk-help)
  145.                      (dest  "SBase4pro")
  146.                   )
  147.                   (copyfiles
  148.                      (source "ram:Disk.info")
  149.                      (dest "SBase4pro:")
  150.                      (infos)
  151.                   )
  152.                   (working
  153.                              "Preparing SBase4pro disk.\n"
  154.                              "\n**********\n"
  155.                              "This could take several minutes so please be patient!\n"
  156.                              "**********"
  157.                   )
  158.                   (if (run (cat "ram:lharc >nil: -m -n x ram:prog.lzh SBase4pro:"))
  159.                      (abort "Program files Decompression failed")
  160.                   )
  161.                   (delete "ram:prog.lzh")
  162.                   (if (run (cat "ram:registersb SBase4pro:SBase4pro \"" name "\" \"" org "\" \"" serialno "\""))
  163.                      (abort "Program Registration failed")
  164.                   )
  165.                   (delete "ram:registersb")
  166.  
  167.                   (if (run (cat "ram:lharc >nil: -m -n x ram:printers.lzh SBase4pro:"))
  168.                      (abort "Printer files Decompression failed")
  169.                   )
  170.                   (delete "ram:printers.lzh")
  171.  
  172.                   (copyfiles
  173.                      (source "Install_SBase4pro:sbfd.lzh")
  174.                      (dest "ram:")
  175.                   )
  176.                   (askdisk
  177.                      (prompt "Please insert the diskette labeled \"SBase4\""
  178.                              " in any drive.")
  179.                      (help @askdisk-help)
  180.                      (dest  "SBase4")
  181.                   )
  182.                   (copyfiles
  183.                      (source "ram:Disk.info")
  184.                      (dest "SBase4:")
  185.                      (infos)
  186.                   )
  187.                   (working
  188.                              "Preparing SBase4 form designer disk.\n"
  189.                              "\n**********\n"
  190.                              "This could take several minutes so please be patient!\n"
  191.                              "**********"
  192.                   )
  193.                   (if (run (cat "ram:lharc >nil: -m -n x ram:sbfd.lzh SBase4:"))
  194.                      (abort "Program files Decompression failed")
  195.                   )
  196.                   (delete "ram:sbfd.lzh")
  197.  
  198.                )
  199.             )
  200.             (complete 50)
  201.             (if (IN installlevel 1)
  202.                (
  203.                   (askdisk
  204.                      (prompt "Please insert the diskette labeled \"Install_SBase4pro:\""
  205.                              " in any drive.")
  206.                      (help @askdisk-help)
  207.                      (dest  "Install_SBase4pro")
  208.                   )
  209.                   (copyfiles
  210.                      (source "Install_SBase4pro:examples.lzh")
  211.                      (dest "ram:")
  212.                   )
  213.                   (askdisk
  214.                      (prompt "Please insert the diskette labeled \"SBase4:\""
  215.                              " in any drive.")
  216.                      (help @askdisk-help)
  217.                      (dest  "SBase4")
  218.                   )
  219.                   (working
  220.                              "Preparing Examples.\n"
  221.                              "\n**********\n"
  222.                              "This could take several minutes so please be patient!\n"
  223.                              "**********"
  224.                   )
  225.                   (if (run (cat "ram:lharc >nil: -m -n x ram:examples.lzh SBase4:"))
  226.                      (abort "Examples files Decompression failed")
  227.                   )
  228.                   (delete "ram:examples.lzh")
  229.                )
  230.             )
  231.          )
  232.          (abort "User Request")
  233.       )
  234.    )
  235.    (  ; --- hard disk install ***********************************
  236.  
  237.  
  238.       (set sb_dest (tackon @default-dest "SBase4"))
  239.  
  240.       (set sb_dest
  241.          (askdir
  242.             (prompt "Where would you like to install SBase4pro?"
  243.             )
  244.             (help   "The suggested path is on your volume with the"
  245.                     " most available space.  If you wish it to be"
  246.                     " elsewhere, simply change the name.  If the drawer does"
  247.                     " not exist, it will be added to the indicated"
  248.                     " volume, along with an icon.  Some examples will be"
  249.                     " installed to the same location."
  250.             )
  251.             (newpath)
  252.             (default sb_dest)
  253.          )
  254.       )
  255.  
  256.       (makedir sb_dest (infos))
  257.  
  258.       (set @default-dest sb_dest)
  259.       (if (IN installlevel 0)
  260.          (
  261.             (copyfiles
  262.                (source "Install_SBase4pro:prog.lzh")
  263.                (dest "ram:")
  264.             )
  265.             (working
  266.                        "Preparing SBase4 program files.\n"
  267.                        "\n**********\n"
  268.                        "This could take several minutes so please be patient!\n"
  269.                        "**********"
  270.             )
  271.             (if (run (cat "ram:lharc >nil: -m -n x ram:prog.lzh " (tackon sb_dest " ")))
  272.                (abort "Program files Decompression failed")
  273.             )
  274.             (delete "ram:prog.lzh")
  275.  
  276.             (copyfiles
  277.                (source "Install_SBase4pro:sbfd.lzh")
  278.                (dest "ram:")
  279.             )
  280.             (working
  281.                        "Preparing SBase4 program files.\n"
  282.                        "\n**********\n"
  283.                        "This could take several minutes so please be patient!\n"
  284.                        "**********"
  285.             )
  286.             (if (run (cat "ram:lharc >nil: -m -n x ram:sbfd.lzh " (tackon sb_dest " ")))
  287.                (abort "Program files Decompression failed")
  288.             )
  289.             (delete "ram:sbfd.lzh")
  290.  
  291.             (if (run (cat "Install_SBase4pro:registersb \"" (tackon sb_dest "SBase4pro") "\" \"" name "\" \"" org "\" \"" serialno "\""))
  292.                (abort "Program Registration failed")
  293.             )
  294.             (delete "ram:registersb")
  295.  
  296.             (copyfiles
  297.                (source "Install_SBase4pro:printers.lzh")
  298.                (dest "ram:")
  299.             )
  300.             (working
  301.                        "Preparing SBase4 program files.\n"
  302.                        "\n**********\n"
  303.                        "This could take several minutes so please be patient!\n"
  304.                        "**********"
  305.             )
  306.             (if (run (cat "ram:lharc >nil: -m -n x ram:printers.lzh " (tackon sb_dest " ")))
  307.                (abort "Printer files Decompression failed")
  308.             )
  309.             (delete "ram:printers.lzh")
  310.  
  311.             (if (= (exists "sys:wbstartup" (noreq)) 2)
  312.                (
  313. ;                  (message "wbstartup found: " val)
  314.                   (
  315.                      (textfile
  316.                         (prompt "Creating the SBase4 Assignment file in sys:WBstartup\n"
  317.                         )
  318.                         (help "This file is required to assign SBase4: to the drawer"
  319.                               " which contains SBase.  It is placed into sys:WBstartup"
  320.                               " so it will be executed when workbench is started up."
  321.                               " If you do not use workbench, then you will have to"
  322.                               " add this to your user-startup file, or do it manually."
  323.                         )
  324.                         (dest "sys:WBstartup/AssignSB")
  325.                         (append "echo \"SBase4 Assign Initialization\"\n")
  326.                         (append "assign SBase4: \"" sb_dest "\"\n")
  327.                         (confirm)
  328.                      )
  329.                      (copyfiles
  330.                         (source "Install_SBase4pro:icons/AssignSB.info")
  331.                         (dest "sys:WBstartup")
  332.                      )
  333.                   )
  334.                )
  335.                (
  336. ;                  (message "wbstartup not found - add to user-startup: " val)
  337.                   (startup "SBase4"
  338.                      (prompt "add assignment to user-startup")
  339.                      (help "This file is required to assign SBase4: to the drawer"
  340.                            " which contains SBase."
  341.                      )
  342.                      (command "assign SBase4: \"" sb_dest "\"\n")
  343.                   )
  344.                )
  345.             )
  346.  
  347.          )
  348.       )
  349.       (complete 50)
  350.       (if (IN installlevel 1)
  351.          (
  352.             (askdisk
  353.                (prompt "Please insert the diskette labeled \"Install_SBase4pro:\""
  354.                        " in any drive.")
  355.                (help @askdisk-help)
  356.                (dest  "Install_SBase4pro")
  357.             )
  358.             (copyfiles
  359.                (source "Install_SBase4pro:examples.lzh")
  360.                (dest "ram:")
  361.             )
  362.             (working
  363.                        "Preparing Examples.\n"
  364.                        "\n**********\n"
  365.                        "This could take several minutes so please be patient!\n"
  366.                        "**********"
  367.             )
  368.             (if (run (cat "ram:lharc >nil: -m -n x ram:examples.lzh " (tackon sb_dest " ")))
  369.                (abort "Examples Decompression failed")
  370.             )
  371.             (delete "ram:examples.lzh")
  372.          )
  373.       )
  374.    )
  375. )
  376.  
  377. (delete "ram:lharc" (safe))
  378.  
  379. (complete 100)
  380.  
  381. (exit)
  382.